#include "comm.hpp"
#include <iostream>
#include <string>

int main()
{
    int fd = open("file.fifo", O_APPEND | O_WRONLY);
    if(fd < 0) { log(FATAL, "%s:%d:open err", __FILE__, __LINE__); exit(1); }
    std::string buff;
    while(true)
    {
        std::cout << "please enter@ ";
        std::getline(std::cin, buff);
        ssize_t s = write(fd, buff.c_str(), buff.size());
        if(s < 0) { log(ERROR, "%s:%d:write err", __FILE__, __LINE__); exit(1); }
        else { log(LOG, "Clicent send a msg..."); }
    }
    log(LOG, "clicent quit");
    return 0;
}